<template>
    <div>
        <el-tabs v-model="tagName" @tab-click="handleClick">
            <el-tab-pane label="面试邀请" name="interviewInvitation">
                <el-table :data="interviewData">
                    <el-table-column prop="interviewTime" label="面试时间"></el-table-column>
                    <el-table-column prop="interviewPosition" label="面试职位"></el-table-column>
                    <el-table-column prop="salaryPackage" label="薪资待遇"></el-table-column>
                    <el-table-column prop="linkman" label="联系人"></el-table-column>
                    <el-table-column prop="interviewLocation" label="面试地点"></el-table-column>
                    <el-table-column prop="state" label="状态">
                        <template #default="scope">
                            <el-link v-if="yesThroughState(scope.row)" type="success" :underline="false">通过</el-link>
                            <el-link v-if="itSInterviewReady(scope.row)" type="warning" :underline="false">待面试</el-link>
                            <el-link v-if="outOfPlace(scope.row)" type="info" :underline="false">不合适</el-link>
                            <el-link v-if="haveExpired(scope.row)" type="info" :underline="false">已过期</el-link>
                        </template>
                    </el-table-column>
                    <el-table-column label="操作">
                        <template #default="scope">
                            <el-button @click="handleClick(scope.row)" type="text" size="small">查看</el-button>
                        </template>
                    </el-table-column>
                </el-table>
            </el-tab-pane>
            <el-tab-pane label="已投递" name="delivered">
                <el-table :data="deliveryData">
                    <el-table-column prop="jobTitle" label="职位名称"></el-table-column>
                    <el-table-column prop="companyName" label="单位名称"></el-table-column>
                    <el-table-column prop="workplace" label="工作地点"></el-table-column>
                    <el-table-column prop="jobCategory" label="工作性质"></el-table-column>
                    <el-table-column prop="salaryPackage" label="薪资待遇"></el-table-column>
                    <el-table-column prop="timeOfApplication" label="申请时间"></el-table-column>
                    <el-table-column label="操作">
                        <template #default="scope">
                            <el-button @click="handleClick(scope.row)" type="text" size="small">查看</el-button>
                        </template>
                    </el-table-column>
                </el-table>
            </el-tab-pane>
        </el-tabs>
    </div>
</template>
<script>
export default {
    data() {
        return {
            tagName: 'interviewInvitation',
            interviewData: [
                {
                    interviewTime: '11-07 11：41',
                    interviewPosition: '项目运营推广\n' + '江苏汇淘文化传媒有限公司',
                    salaryPackage: '6k-8k',
                    linkman: '胡经理 18137143860',
                    interviewLocation: '浙江绍兴市上虞市杭州湾上虞经济技术\n' + '开发区纬五路6号',
                    state: '通过'
                },
                {
                    interviewTime: '11-07 11：41',
                    interviewPosition: '项目运营推广\n' + '江苏汇淘文化传媒有限公司',
                    salaryPackage: '6k-8k',
                    linkman: '胡经理 18137143860',
                    interviewLocation: '浙江绍兴市上虞市杭州湾上虞经济技术\n' + '开发区纬五路6号',
                    state: '不合适'
                },
                {
                    interviewTime: '11-07 11：41',
                    interviewPosition: '项目运营推广\n' + '江苏汇淘文化传媒有限公司',
                    salaryPackage: '6k-8k',
                    linkman: '胡经理 18137143860',
                    interviewLocation: '浙江绍兴市上虞市杭州湾上虞经济技术\n' + '开发区纬五路6号',
                    state: '待面试'
                }
            ],
            deliveryData: [
                {
                    jobTitle: '11-07 11：41',
                    companyName: '项目运营推广\n' + '江苏汇淘文化传媒有限公司',
                    workplace: '6k-8k',
                    jobCategory: '胡经理 18137143860',
                    salaryPackage: '浙江绍兴市上虞市杭州湾上虞经济技术\n' + '开发区纬五路6号',
                    timeOfApplication: '待面试'
                }
            ]
        };
    },
    methods: {
        yesThroughState: function (data) {
            return data.state === '通过' ? true : false;
        },
        itSInterviewReady: function (data) {
            return data.state === '待面试' ? true : false;
        },
        outOfPlace: function (data) {
            return data.state === '不合适' ? true : false;
        },
        haveExpired: function (data) {
            return data.state === '已过期' ? true : false;
        }
    }
};
</script>
